#ifndef USERPROG_SYSCALL_H
#define USERPROG_SYSCALL_H

#include <stdio.h>
#include <syscall-nr.h>
#include <devices/shutdown.h>
#include <string.h>
#include <filesys/file.h>
#include <devices/input.h>
#include <threads/malloc.h>
#include <threads/palloc.h>

#include "threads/interrupt.h"
#include "threads/thread.h"
#include "process.h"
#include "pagedir.h"
#include <threads/vaddr.h>
#include <filesys/filesys.h>

# define MAX_SYS_CALL 20
# define USER_VADDR_BOUND (void*) 0x08048000

void syscall_init (void);
void exit_special (void);

// Added by Eplankton (2022/12/5) lab5
static void syscall_handler(struct intr_frame *);
static void (*syscalls[MAX_SYS_CALL])(struct intr_frame *);
struct thread_file *search_file_by_fd(int fd);

void sys_halt(struct intr_frame *f);
void sys_exit(struct intr_frame *f);
void sys_exec(struct intr_frame *f);
void sys_create(struct intr_frame *f);
void sys_remove(struct intr_frame *f);
void sys_open(struct intr_frame *f);
void sys_wait(struct intr_frame *f);
void sys_filesize(struct intr_frame *f);
void sys_read(struct intr_frame *f);
void sys_write(struct intr_frame *f);
void sys_seek(struct intr_frame *f);
void sys_tell(struct intr_frame *f);
void sys_close(struct intr_frame *f);

#endif /* userprog/syscall.h */
